import sys

from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
from PyQt5.QtGui import QIcon

class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.init_UI()

    def init_UI(self):
        self.resize(300, 300)
        self.button = QPushButton('Ro&&ck', self)
        self.button.setShortcut("Alt+F7")
        # 设置默认按钮
        self.button.setDefault(False)
        #设置按钮是否被按下
        # self.button.setEnabled(False)
        self.show()


if __name__ == "__main__":
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())
